YES 0.8180000000000001
H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/List.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:
↳ HASKELL
↳ CR
mainModule List
| ((insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]) :: (a -> a -> Ordering) -> a -> [a] -> [a]) |
module List where
| import qualified Maybe import qualified Prelude
|
| insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
insertBy | _ x [] | = | x : [] |
insertBy | cmp x ys@(y : ys') | = |
case | cmp x y of |
| GT | -> | y : insertBy cmp x ys' |
| _ | -> | x : ys |
|
|
module Maybe where
| import qualified List import qualified Prelude
|
Case Reductions:
The following Case expression
case | cmp x y of |
| GT | → y : insertBy cmp x ys' |
| _ | → x : ys |
is transformed to
insertBy0 | y cmp x ys' ys GT | = y : insertBy cmp x ys' |
insertBy0 | y cmp x ys' ys _ | = x : ys |
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
mainModule List
| ((insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]) :: (a -> a -> Ordering) -> a -> [a] -> [a]) |
module List where
| import qualified Maybe import qualified Prelude
|
| insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
insertBy | _ x [] | = | x : [] |
insertBy | cmp x ys@(y : ys') | = | insertBy0 y cmp x ys' ys (cmp x y) |
|
|
insertBy0 | y cmp x ys' ys GT | = | y : insertBy cmp x ys' |
insertBy0 | y cmp x ys' ys _ | = | x : ys |
|
module Maybe where
| import qualified List import qualified Prelude
|
Replaced joker patterns by fresh variables and removed binding patterns.
Binding Reductions:
The bind variable of the following binding Pattern
ys@(vy : vz)
is replaced by the following term
vy : vz
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
mainModule List
| ((insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]) :: (a -> a -> Ordering) -> a -> [a] -> [a]) |
module List where
| import qualified Maybe import qualified Prelude
|
| insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
insertBy | vx x [] | = | x : [] |
insertBy | cmp x (vy : vz) | = | insertBy0 vy cmp x vz (vy : vz) (cmp x vy) |
|
|
insertBy0 | y cmp x ys' ys GT | = | y : insertBy cmp x ys' |
insertBy0 | y cmp x ys' ys vw | = | x : ys |
|
module Maybe where
| import qualified List import qualified Prelude
|
Cond Reductions:
The following Function with conditions
is transformed to
undefined0 | True | = undefined |
undefined1 | | = undefined0 False |
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ Narrow
mainModule List
| (insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]) |
module List where
| import qualified Maybe import qualified Prelude
|
| insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
insertBy | vx x [] | = | x : [] |
insertBy | cmp x (vy : vz) | = | insertBy0 vy cmp x vz (vy : vz) (cmp x vy) |
|
|
insertBy0 | y cmp x ys' ys GT | = | y : insertBy cmp x ys' |
insertBy0 | y cmp x ys' ys vw | = | x : ys |
|
module Maybe where
| import qualified List import qualified Prelude
|
Haskell To QDPs
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ Narrow
↳ QDP
↳ QDPSizeChangeProof
Q DP problem:
The TRS P consists of the following rules:
new_insertBy0(ww50, ww3, ww4, ww51, ba) → new_insertBy(ww3, ww4, ww51, ba)
new_insertBy(ww3, ww4, :(ww50, ww51), ba) → new_insertBy0(ww50, ww3, ww4, ww51, ba)
R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- new_insertBy(ww3, ww4, :(ww50, ww51), ba) → new_insertBy0(ww50, ww3, ww4, ww51, ba)
The graph contains the following edges 3 > 1, 1 >= 2, 2 >= 3, 3 > 4, 4 >= 5
- new_insertBy0(ww50, ww3, ww4, ww51, ba) → new_insertBy(ww3, ww4, ww51, ba)
The graph contains the following edges 2 >= 1, 3 >= 2, 4 >= 3, 5 >= 4